package sync.hw.demo01;

/**
 * @author lwj
 * @date 2025-03-12
 * @vesion 1.0.0
 */
public class MainTest {
    public static void main(String[] args) {
        // 用户信息
        UserInfo husband = new UserInfo("老公","存折",2000d);
        UserInfo wife = new UserInfo("老婆","银联",2000d);

        // 银行信息
        BankInfo bankInfo = new BankInfo(5000d);

        // 实例化 Runnable 对象
        MyRunnable mr1 = new MyRunnable(bankInfo,husband);
        MyRunnable mr2 = new MyRunnable(bankInfo,wife);

        // 实例化 Thread 对象
        Thread t1 = new Thread(mr1);
        Thread t2 = new Thread(mr2);

        // 启动线程
        t1.start();
        t2.start();
    }
}
